#pragma once

#include <gexpl_timer_chctl.h>
#include <gofcl_timer_chctl01.h>

typedef struct {
	timer_chctl_byte_expl_s channel_02;
	timer_chctl_byte_expl_s channel_13;
} __attribute__((aligned(2))) timer_chctl_expl_s;

_Static_assert(sizeof(timer_chctl_expl_s) == 2,
	       "Struct timer_chctl_expl_s defined error!");

static inline void timer_channel_setup(timer_qe timer_q,
				       timer_chctl_re channel_r,
				       timer_chctl_expl_s chctl) {
	union {
		timer_chctl_expl_s e;
		timer_chctl_s c;
	} cu = {
		.e = chctl,
	};
	timer_wreg_chctl_s(timer_q, channel_r, cu.c);
}
